<div class="center">
	<div class="home">
    	<div class="home_left">
        	<?php echo $this->partial('member/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user,'account'=>$this->account)); ?>
        </div>
    	<div class="home_right">
			<div class="replacerechargetop">
            	<i>代支付服务</i>
                <div class="replacerechargetname">
                	<h1>我的代支付记录</h1>
                    <p>身在海外无法对支付平台进行充值，悠奇代支付服务为您解决烦恼。</p>
                </div>
            </div>
			<div class="replacerechargetab">
            	<ul>
                	<li><a class="tab1" href="/member/agentpay"><i>  </i>申请代支付</a></li>
                	<li class="tabon"><a class="tab2" href="#"><i></i>我的代支付记录</a></li>
                </ul>
            </div>
            <div class="applyjilu">
            <?php if(count($this->list['list'])>0)
                  {?>
            	<div class="applylist">
                    <table>
                        <tr>
                            <th class="j1">流水号</th>
                            <th class="j2">申请时间</th>
                            <th class="j3">支付金额(￥)</th>
                            <th class="j4">支付类型</th>
                            <th class="j5">支付项</th>
                            <th class="j5">状态</th>
                            <th class="j6">操作</th>
                        </tr>
                        <?php 
                        	foreach($this->list['list'] as $item)
                        	{ 
                        		
                       	?>
                        <tr>
                            <td class="j1"><?php echo $item->id; ?></td>
                            <td class="j2"><?php echo $item->dateCreated; ?></td>
                            <td class="j3"><?php echo number_format($item->money,2); ?></td>
                            <td class="j4"><?= $item->getTypeName() ?></td>
                            <td class="j4"><?= $item->Type?$item->Code:$item->Url ?></td>
                            <td class="j5">
                                <span >
                                    <?php echo $item->statuscaption;?>
                                </span>
                            </td>
                            <td class="j6">
                                <?php if($item->Status == Application_Model_AgentPay::STATUS_nopay || $item->Status == null){?>
                                <a href="/pay/paying/type/<?php echo Application_Model_PayBill::TYPE_AGENT_PAY?>/id/<?php echo $item->id;?>/count/1">付款</a>
                                <?php } ?>
                            </td>
                        </tr>
                        <?php } ?>
                    </table>
                </div>
                <?php }else{ ?>
                      <div class="jilunwu">
                	<p>您还没有代支付记录！</p>
                </div>  
                        <?php } ?>
                 
                <div class="toolbar">
	                <?php echo $this->partial('paging.phtml',array('pages'=>$this->cardOrders)); ?>
                </div>
                
            </div>
            <div class="applyask">
                <div class="askname">
                    <h2>使用遇到的问题</h2>
                </div>
                <ul>
                    <li><a href="http://help.uuch.com/?p=142" target="_blank">1. 代充值申请成功后需要等待多久？</a></li>
                    <li><a href="http://help.uuch.com/?p=144" target="_blank">2. 为什么需要代冲值服务？</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>

<script language="javascript">
	function Cancel(id)
	{
		jQuery.ajax({
            type: "POST",
            url: "/member/list/",
            data: {"id":id,"type":1},	//1为取消
            dataType:"json",
            success: function(obj){
            	if(obj.ret == 1)
    			{
	    			window.location.href = "/member/list";
    			}
    			else
    			{
	    			switch(obj.ret)
	    			{
	    				case -1:
	    					alert("取消失败");
		    				break;
	    			}
    			}
            }
        });
	}

	function Delete(id)
	{
		jQuery.ajax({
            type: "POST",
            url: "/member/agentpaylist/",
            data: {"id":id,"type":2},	//2为删除
            dataType:"json",
            success: function(obj){
            	if(obj.ret == 1)
    			{
	    			window.location.href = "/member/list";
    			}
    			else
    			{
	    			switch(obj.ret)
	    			{
	    				case -1:
	    					alert("取消失败");
		    				break;
	    			}
    			}
            }
        });
	}
</script>